IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spFiles_Update')
	BEGIN
		PRINT 'Dropping Procedure spFiles_Update'
		DROP  Procedure  spFiles_Update
	END

GO

PRINT 'Creating Procedure spFiles_Update'
GO
Create Procedure dbo.spFiles_Update
	( 	  
		@FileNo varchar(50), 
		@BoxNo varchar(50) = null, 
		@DivisionName varchar(50) = null, 
		@DepartmentName varchar(50) = null, 
		@CategoryName varchar(50) = null, 
		@ProductName varchar(50) = null, 
		@Archive_ID int = null, 
		@FileStatus varchar(50) = null, 
		@Notes varchar(250) = null, 
		@Description varchar(100) = null, 
		@FromNo int = null, 
		@ToNo int = null, 
		@FromDate DateTime = null, 
		@ToDate DateTime = null, 
		@FromAlpha varchar(50) = null, 
		@ToAlpha varchar(50) = null, 
		@CreatedDate DateTime = null, 
		@CreatedByUser_ID numeric(9,0) = null, 
		@Request_ID int = null, 
		@RequestDate DateTime = null, 
		@RequestedByUser_ID numeric(9,0) = null, 
		@RequestedDate DateTime = null
	)
AS
  /* 
    ------------------------------------------------------------------------------
    - Change History
    - --------------
    - Date          Description
    ------------------------------------------------------------------------------
    - 2007/11/02    Initial version Updated
    ------------------------------------------------------------------------------
  */

	-- Declare the required variables

	-- Update the required new record
	UPDATE Files
	SET
		BoxNo = @BoxNo, 
		DivisionName = @DivisionName, 
		DepartmentName = @DepartmentName, 
		CategoryName = @CategoryName, 
		ProductName = @ProductName, 
		Archive_ID = @Archive_ID, 
		FileStatus = @FileStatus, 
		Notes = @Notes, 
		Description = @Description, 
		FromNo = @FromNo, 
		ToNo = @ToNo, 
		FromDate = @FromDate, 
		ToDate = @ToDate, 
		FromAlpha = @FromAlpha, 
		ToAlpha = @ToAlpha, 
		CreatedDate = @CreatedDate, 
		CreatedByUser_ID = @CreatedByUser_ID, 
		Request_ID = @Request_ID, 
		RequestDate = @RequestDate, 
		RequestedByUser_ID = @RequestedByUser_ID, 
		RequestedDate = @RequestedDate		
	WHERE FileNo = @FileNo

	-- Return to calling method
	RETURN
	
GO
